<script type="text/javascript">
    setTimeout(function(){
        jQuery(".chzn-select").chosen();
    },1);
</script>
<div class="breadcrumbwidget">
	<ul class="skins">
        <li><a href="default" class="skin-color default"></a></li>
        <li><a href="orange" class="skin-color orange"></a></li>
        <li>&nbsp;</li>
        <li class="fixed"><a href="" class="skin-layout fixed"></a></li>
        <li class="wide"><a href="" class="skin-layout wide"></a></li>
    </ul><!--skins-->
	<ul class="breadcrumb">
        <li><a href="<?php echo $baseurl?>">Trang chủ</a> <span class="divider">/</span></li>
        <li class="active">Thêm người dùng</li>
    </ul>
</div><!--breadcrumbwidget-->
<div class="pagetitle">
	<h1>Thêm người dùng</h1> <span></span>
</div>
<div class="maincontent">
    <?php if(validation_errors()):?>
        <div class="alert alert-error" style="margin: 10px 10px 10px 40px;">
          <button data-dismiss="alert" class="close" type="button">×</button>
          <?php echo validation_errors(); ?>
        </div>
    <?php endif;?>
    <div class="contentinner content-dashboard">    
    
    <p style="margin: 10px 5px 10px 0px;font-size: 18px;">
        Thông tin cơ bản
            <hr style="border-top: 1px soild #DCDCDC !important;margin: 0px;" />
    </p>
    <?php $attr = array('class' => 'stdform'); echo form_open_multipart('', $attr)?>
    
	<p>
		<label>Chọn nhóm ( * )</label>
		<span class="formwrapper">
			<select data-placeholder="Chọn 1 nhóm..." style="width:350px" class="chzn-select" tabindex="2" name="capdo" id="capdo">
					<option value="2">Lãnh đạo</option>
					<option value="3">Nhân viên</option>
			</select>
		</span>
	</p>
	
    <p>
    	<label>Tên đăng nhập ( * )</label>
        <span class="field"><input type="text" value="<?php echo $this->input->post('tendangnhap');?>" name="tendangnhap" class="input-xxlarge tendangnhap" placeholder="Tên đăng nhập" /></span>
    </p>
    
	<p>
    	<label>Mật khẩu ( * )</label>
        <span class="field"><input type="text" value="<?php echo $this->input->post('matkhau');?>" name="matkhau" class="input-xxlarge matkhau" placeholder="Mật khẩu" /></span>
    </p>
	
	<p>
    	<label>Họ tên ( * )</label>
        <span class="field"><input type="text" value="<?php echo $this->input->post('hoten');?>" name="hoten" class="input-xxlarge hoten" placeholder="Họ tên" /></span>
    </p>
	
	<p>
    	<label>Ngày sinh ( * )</label>
        <span class="field"><input id="datepicker" type="text" name="ngaysinh" value="<?php echo $this->input->post('ngaysinh');?>" /></span>
		<script>
	
    $( "#datepicker" ).datepicker({ dateFormat: 'dd/mm/yy' });
    

		</script>
    </p>
	<p>
    	<label>Địa chỉ ( * )</label>
        <span class="field"><input type="text" value="<?php echo $this->input->post('diachi');?>" name="diachi" class="input-xxlarge diachi" placeholder="Địa chỉ" /></span>
    </p>
	<p>
    	<label>Chức vụ ( * )</label>
        <span class="field"><input type="text" value="<?php echo $this->input->post('chucvu');?>" name="chucvu" class="input-xxlarge chucvu" placeholder="Chức vụ" /></span>
    </p>
	<p>
    	<label>Chức danh ( * )</label>
        <span class="field"><input type="text" value="<?php echo $this->input->post('chucdanh');?>" name="chucdanh" class="input-xxlarge chucdanh" placeholder="Chức danh" /></span>
    </p>
	
    <p>
        <label></label>
        <button class="btn btn-rounded" type="submit"> <i class="iconfa-ok"></i> &nbsp; Lưu lại</button>
        <button class="btn btn-rounded" type="button" onclick="window.location='<?php echo $baseurl.'manage/nguoidung/index'?>'"> <i class="icon-arrow-right"></i> &nbsp; Hủy bỏ</button>
    </p>
    
    </form>
    </div>
</div>
<script>

function convertimage(id, id_parse, img_show)
{
    var id = id;
    var id_parse = id_parse;
    var img_show = img_show;
    var filesSelected = document.getElementById(id).files;
    if (filesSelected.length > 0)
    {
        var fileToLoad = filesSelected[0];

        var fileReader = new FileReader();

        fileReader.onload = function(fileLoadedEvent) 
        {
            $("#"+id_parse).attr('value', fileLoadedEvent.target.result);
            //document.getElementById('cddd').html(fileLoadedEvent.target.result);
            $("#"+img_show).attr('src', fileLoadedEvent.target.result);
        };

        fileReader.readAsDataURL(fileToLoad);
    }
}
</script>